<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{$siteInfo['title']}-{$siteInfo['subtitle']}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href="/themes/amaze/assets/css/amazeui.min.css">
</head>
<body>
{include file="common/header" /}
<div class="am-container">
    <div class="orderInfo">
        <p>订单编号：{$orderInfo.orderId}</p>
        <p>商品编号：{$orderInfo.goodsId}</p>
        <p>商品名称：{$orderInfo.goodsTitle}</p>
        <p>结算价格：{$orderInfo.price}</p>
        {eq name="$orderInfo.price" value="0"}
        <a class="am-btn am-btn-danger am-btn-block" href="{$downloadURL}">下载资源</a>
        {else/}
        <button type="button" onclick="pay('{$orderInfo.orderId}')" class="am-btn am-btn-danger am-btn-block">去付款</button>
        {/eq}
    </div>
</div>
{include file="common/footer" /}
</body>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="/themes/amaze/assets/js/amazeui.min.js"></script>
<script src="/themes/amaze/assets/js/common.js"></script>
<script>
    function pay(orderId) {
        $.ajax({
            type:"POST",
            data:{
                order_id:orderId
            },
            url:"/shop/pay/wxPay",
            success:function (e) {
                if (e.code == 1){
                    location.href = e.url;
                }
            }
        })
    }
</script>
</html>